<%@ page language="java" import="java.util.*,java.sql.*,telbook.JDBCUtils" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加好友</title>
<style type="text/css">
        /*表格样式*/			
        table {
            width: 90%;
            background: #ccc;
            margin: 10px auto;
            border-collapse: collapse;/*border-collapse:collapse合并内外边距(去除表格单元格默认的2个像素内外边距*/	
        }				
        th,td {
            height: 25px;
            line-height: 25px;
            text-align: center;
            border: 1px solid #ccc;
        }
        td input{
            border: none;
            outline: none;
            font-size: 16px;
            background-color:transparent;
            width:100%;
        }		
        th {
            background: #eee;
            font-weight: normal;
        }		
        tr {
            background: #fff;
        }		
        tr:hover {
            background: #cc0;
        }
        .button{
        	margin-top:3%;
        }
        .button input{
	        border-radius: 10px;
		    border: 0px;
		    width: 70px;
		    height: 30px;
		    background-color:rgb(41, 96, 212);
		    color: white;
		    font-size: 15px;
		    cursor: pointer;
        }
        .button input:hover{
        	background: green;
        }
    </style>
</head>
<body>
<%
	Object test=null;
	Cookie[]cookies=request.getCookies();
	for(int i=0;cookies!=null&&i<cookies.length;i++)
	{
		if("userbean".equals(cookies[i].getName())){
			test=cookies[i].getValue();
			break;
		}
	}
	if(test==null){
%>
	<jsp:forward page="loginin.jsp"></jsp:forward>
<% return;}%>
	<div align="center">
		<form action="AddServlet" method="POST">
			<table border="1">
	            <tr>
	                <th>姓名</th>
	                <td><input type="text" required name="name"></td>
	            </tr>
	            <tr>
	                <th>电话</th>
	                <td><input type="text" required name="number"></td>
	            </tr>
	            <tr>
	                <th>家庭地址</th>
	                <td><input type="text" required name="address"></td>
	            </tr>
	            <tr>
	                <th>QQ号</th>
	                <td><input type="text" required name="qq"></td>
	            </tr>
	        </table>
	        <div style="color:red;width:100%;text-align:center;">${DBMes}</div>
	        <div class="button">
	        	<input type="submit" value="添加">
	        	<input type="reset" value="取消" style="margin-left: 20%;">
                  
                  
            </div>
		</form>
	        
      </div> 
</body>
</html>